home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / libgrx / ndrivers / pieces / chkevga.c < prev    next >
Encoding:
Text File  |  1993-12-06  |  1.1 KB  |  34 lines

  1. /**
  2.  ** CHKEVGA.C ---- code fragment to check for EGA or VGA
  3.  **
  4.  ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  5.  ** Copyright (C) 1992 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
  6.  ** Copyright (C) 1993 Grzegorz Mazur, gbm@ii.pw.edu.pl
  7.  **
  8.  ** This file is distributed under the terms listed in the document
  9.  ** "copying.dj", available from DJ Delorie at the address above.
  10.  ** A copy of "copying.dj" should accompany this file; if not, a copy
  11.  ** should be available from where this file was obtained.  This file
  12.  ** may not be distributed without a verbatim copy of "copying.dj".
  13.  **
  14.  ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  15.  ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16.  **/
  17.  
  18. int check_for_EGAVGA(void)
  19. {
  20.     /* check for EGA/VGA by trying to get pointer to 8x14 ROM BIOS font */
  21.     asm push bp;
  22.     _BP = 0xffff;
  23.     _ES = _BP;
  24.     _AX = 0x1130;
  25.     _BX = 0x0200;
  26.     _CX = 0;
  27.     geninterrupt(0x10);
  28.     _AX = _ES;
  29.     _DX = _BP;
  30.     asm pop  bp;
  31.     return(((_AX != 0xffff) && (_DX != 0xffff) && (_CX >= 14) && (_CX <= 16)) ? 1 : 0);
  32. }
  33.  
  34.